home *** CD-ROM | disk | FTP | other *** search
/ Kid Vid Grid: The Cartoon Moving Puzzle Game / Kid Vid Grid (1994)(Jasmine Multimedia).iso / vfw / setup.mst < prev    next >
Text File  |  1994-11-03  |  12KB  |  317 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1d Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40. DECLARE FUNCTION KidGridIni LIB "kiddir.dll" AS INTEGER
  41. DECLARE SUB InitKidName LIB "kiddir.dll"
  42.  
  43. INIT:
  44.   
  45.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  46.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  47.     
  48.     WIN32ENABLED% = 0
  49.     MajorVer% = GetWindowsMajorVersion()
  50.     MinorVer% = GetWindowsMinorVersion()
  51.     Processor% = GetProcessorType()
  52.     WinDir$ = GetWindowsDir()
  53.     DEST$ = GetWindowsDir()
  54.     WinSysDir$ = GetWindowsSysDir()
  55.     WinSys32Dir$ = WinDir$ + "system32"
  56.  
  57.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  58.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  59.     END
  60.     END IF
  61.  
  62.     'Prevents installation on 286
  63.     IF Processor% < 3 THEN
  64.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  65.     END
  66.     END IF
  67.  
  68.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  69.     IF OnWindowsNT() THEN
  70.       OnNT$ = "TRUE"
  71.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  72.       IF WowVersion$ = "" THEN
  73.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  74.          END
  75.       END IF
  76.     END IF
  77.  
  78.     SetBitmap CUIDLL$, LOGO
  79.     SetTitle "Kid Vid Grid"
  80.  
  81.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  82.     IF szInf$ = "" THEN
  83.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  84.     END IF
  85.     ReadInfFile szInf$
  86.  
  87.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  88.  
  89. WELCOME:
  90.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  91.     IF sz$ = "CONTINUE" THEN
  92.        UIPop 1
  93.      ELSE
  94.     GOSUB ASKQUIT
  95.     GOTO WELCOME
  96.     END IF
  97.  
  98. KIDGRID:
  99.     i% = KidGridIni()
  100.     IF i% = 1 THEN
  101.         GOSUB ASKQUIT
  102.     ELSEIF i% = 2 THEN
  103.         END
  104.     GOTO KIDGRID
  105.     END IF    
  106.  
  107. ''Prepare Copy list and check size
  108.  
  109.     ClearCopyList
  110.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  111.  
  112. ''  Runtime files (on Windows disk)
  113. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  114.  
  115.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  116.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  117.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  118.     END IF
  119.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  120.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  121.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  122.     IF OnNT$ = "TRUE" THEN
  123.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  124.     ENDIF
  125. ''*************************************************************************************************************************
  126. ''*************************************************************************************************************************
  127. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  128. ''and add a "DCI Provider" section with to the SETUP.INF file.
  129. ''
  130. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  131. ''*************************************************************************************************************************
  132. ''*************************************************************************************************************************
  133.  
  134.     AddSectionFilesToCopyList "WaveMix", SrcDir$, WinDir$    
  135.     KidDir$ = GetIniKeyString (WinDir$ + "kidgrid.ini", "KidVidGrid 1.00", "Path")
  136.     AddSectionFilesToCopyList "KidGrid", SrcDir$, KidDir$
  137.  
  138. ''  Check windrive diskspace
  139.     SizeReq& = GetCopyListCost ("","", "")
  140.     IF SizeReq& <> 0 THEN
  141.     GOSUB SMALLWIN
  142.     END
  143.     END IF
  144.  
  145. Install
  146.  
  147. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  148. '' else, it gives the user the choice
  149.     RESTRT% = RestartListEmpty ()
  150.     Exe$ = DEST$ + "\_msrstrt.exe"
  151.     Batch$ = DEST$ + "\_mssetup.bat"
  152.     empty$ = ""
  153. RESTART:
  154.     IF RESTRT% = 0 THEN
  155.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  156.        IF sz$ = "REACTIVATE" THEN
  157.       GOTO RESTART
  158.        ENDIF
  159.        I% = ExitExecRestart ()
  160.        RemoveFile Exe$, cmoForce
  161.        RemoveFile Batch$, cmoForce
  162.        END
  163.     ELSE
  164.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  165.        IF sz$ = "CONTINUE" THEN
  166.       I% = ExitWindowsExec (Exe$, empty$)
  167.       IF I% = 0 THEN
  168.          GOTO RESTART
  169.       ELSE
  170.          END
  171.      ENDIF
  172.        ELSEIF sz$ = "EXIT" THEN
  173.       UIPopAll
  174.       END
  175.        ELSEIF sz$ = "REACTIVATE" THEN
  176.       GOTO RESTART
  177.        ELSE
  178.       UIPop 1
  179.        END IF
  180.     END IF
  181.  
  182.  
  183. QUIT:
  184.     ON ERROR GOTO ERRQUIT
  185.  
  186.     IF ERR = 0 THEN
  187.     dlg% = EXITSUCCESS
  188.     ELSEIF ERR = STFQUIT THEN
  189.     dlg% = EXITQUIT
  190.     ELSE
  191.     dlg% = EXITFAILURE
  192.     END IF
  193. QUITL1:
  194.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  195.     IF sz$ = "REACTIVATE" THEN
  196.     GOTO QUITL1
  197.     END IF
  198.     UIPop 1
  199.     END
  200.  
  201. ERRQUIT:
  202.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  203.     END
  204.  
  205.  
  206. ASKQUIT:
  207.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  208.  
  209.     IF sz$ = "EXIT" THEN
  210.     UIPopAll
  211. ''        ERROR STFQUIT
  212.     END
  213.     ELSEIF sz$ = "REACTIVATE" THEN
  214.     GOTO ASKQUIT
  215.     ELSE
  216.     UIPop 1
  217.     END IF
  218.     RETURN
  219.  
  220. SMALLWIN:
  221.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  222.     IF sz$ = "REACTIVATE" THEN
  223.     GOTO SMALLWIN
  224.     END IF
  225.     UIPop 1
  226.     RETURN
  227.  
  228. '**
  229. '** Purpose:
  230. '**     Performs all installation operations.
  231. '** Arguments:
  232. '**     none.
  233. '** Returns:
  234. '**     none.
  235. '*************************************************************************
  236. SUB Install STATIC
  237.  
  238.     SetRestartDir WinDir$
  239.     CopyFilesInCopyList
  240.  
  241. '' Kid Vid Grid
  242.     CreateProgmanGroup "Kid Vid Grid", "", cmoOverwrite
  243.     ShowProgmanGroup  "Kid Vid Grid", 1, cmoOverwrite
  244.     ini$ = MID$ (GetSymbolValue("STF_SRCDIR"), 1, 1)
  245.     CreateProgmanItem "Kid Vid Grid", "Kid Vid Grid", ini$ + ":\vg\kidvidgr.exe", "", cmoOverwrite
  246.     InitKidName
  247.  
  248. ''Updating WIN.INI and SYSTEM.INI
  249. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  250.  
  251. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  252.     IF VflatdPresent() = 0 THEN
  253.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  254.     END IF
  255. END IF
  256.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  257.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  259.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  260.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  261.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  262.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  263.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  264.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  265.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  266.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  267.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  268.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  269.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  270.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  271.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  272.  
  273. ''*************************************************************************************************************************
  274. ''*************************************************************************************************************************
  275. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  276. ''
  277. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  278. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  279. ''*************************************************************************************************************************
  280. ''*************************************************************************************************************************
  281.  
  282. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  283. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  284.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  285.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  286.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  287.  
  288. '' Mplayer
  289.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  290.  
  291. END IF    ''NT and next version of Windows installation stop here.
  292.  
  293.     Run ("profdisp.exe")   
  294. END SUB
  295.  
  296. '**
  297. '** Purpose:
  298. '**     Appends a file name to the end of a directory path,
  299. '**     inserting a backslash character as needed.
  300. '** Arguments:
  301. '**     szDir$  - full directory path (with optional ending "\")
  302. '**     szFile$ - filename to append to directory
  303. '** Returns:
  304. '**     Resulting fully qualified path name.
  305. '*************************************************************************
  306. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  307.     IF szDir$ = "" THEN
  308.     MakePath = szFile$
  309.     ELSEIF szFile$ = "" THEN
  310.     MakePath = szDir$
  311.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  312.     MakePath = szDir$ + szFile$
  313.     ELSE
  314.     MakePath = szDir$ + "\" + szFile$
  315.     END IF
  316. END FUNCTION
  317.